package com.async.designpatterns.structure.composite;

import java.util.ArrayList;
import java.util.LinkedList;

public class Tree implements Node {
    LinkedList<Node> nodes = new LinkedList<Node>();

    @Override
    public void add(Node node) {
        nodes.add(node);
    }

    @Override
    public void remove(Node node) {
        nodes.remove(node);
    }

    @Override
    public Node getChildren() {
        return nodes.get(0);
    }

    @Override
    public String getId() {
        return nodes.get(0).getId();
    }
}
